let $info = $('.info');
var init = {
  url : 'http://chst.vip:1234/api/getinlanddiscount',
  success : e
}
function e (res){
  let regExp = /^<[^<]+\s+src="([^''""]*)"/
  let contentStr =""
  res.result.forEach(element => {
    let imgUrl = element.productImg.match(regExp)
    contentStr += `
    <li id=${element.productId}>
      <a href="">
        <div class="image">
        <img src="${imgUrl[1]}" alt="">
        </div>
        <div class="title">${element.productName}</ div>
        <p class="price">${element.productPrice}</p>
        <p class="from">${element.productFrom}|${element.productTime}</p>
      </a>
    </li>`
  });
  $info.append(contentStr)
  $info.on('click','li',function(e){
    e.preventDefault()
    let id = $(this).attr('id')
    window.location.href = "./inlanddiscountitems.html?id=" + id;
  })
    
}

ajaxAPI(init)


// lazyLoad(ajaxAPI(init),20)